#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QMessageBox>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    falsetime = 0;
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_sigin_in_clicked()
{
    QString name = ui->username->text();
    QString passwd = ui->passsword->text();
    if(name == "gec" && passwd == "123456")
    {
        QMessageBox::information(this, "恭喜", "密码账号正确", QMessageBox::Ok);
    }
    else
    {
        QMessageBox::critical(this, "错误", "您输入的账号或者密码错误", QMessageBox::Ok);
        falsetime++;
        if(falsetime == 3)
        {
            ui->username->setEnabled(false);
            ui->passsword->setEnabled(false);
        }
    }
}

